# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.DataMigration.V1.Model.SslConfig do
  @moduledoc """
  SSL configuration information.

  ## Attributes

  *   `caCertificate` (*type:* `String.t`, *default:* `nil`) - Required. Input only. The x509 PEM-encoded certificate of the CA that signed the source database server's certificate. The replica will use this certificate to verify it's connecting to the right host.
  *   `clientCertificate` (*type:* `String.t`, *default:* `nil`) - Input only. The x509 PEM-encoded certificate that will be used by the replica to authenticate against the source database server.If this field is used then the 'client_key' field is mandatory.
  *   `clientKey` (*type:* `String.t`, *default:* `nil`) - Input only. The unencrypted PKCS#1 or PKCS#8 PEM-encoded private key associated with the Client Certificate. If this field is used then the 'client_certificate' field is mandatory.
  *   `type` (*type:* `String.t`, *default:* `nil`) - Optional. The ssl config type according to 'client_key', 'client_certificate' and 'ca_certificate'.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :caCertificate => String.t() | nil,
          :clientCertificate => String.t() | nil,
          :clientKey => String.t() | nil,
          :type => String.t() | nil
        }

  field(:caCertificate)
  field(:clientCertificate)
  field(:clientKey)
  field(:type)
end

defimpl Poison.Decoder, for: GoogleApi.DataMigration.V1.Model.SslConfig do
  def decode(value, options) do
    GoogleApi.DataMigration.V1.Model.SslConfig.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.DataMigration.V1.Model.SslConfig do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
